<section class="content" style="padding: 10px">
    <div class="row">
        <div class="col-12">
            <div class="card card-default">
                <div class="card-header">
                    <h3 class="card-title">搜索</h3>
                </div>


                <div class="card-body">
                    <form role="form" data-form="1" data-search-table-id="1" data-title="自定义标题" >
                        <div class="form-inline"  >
                            <div class="form-group">
                                <label  >姓名：</label>
                                <input type="text" class="form-control" name="name" placeholder="">
                            </div>
                            <div class="form-group">
                                <label  >开始时间：</label>
                                <input type="text" class="form-control" name="start_time" placeholder="" id="start" autocomplete="off">
                            </div>
                            <div class="form-group">
                                <label  >结束时间：</label>
                                <input type="text" class="form-control" name="end_time" placeholder="" id="end" autocomplete="off">
                            </div>
                            <div class="form-group">
                                <label  >状态：</label>
                                <select name="status"  class="selectpicker">
                                    {:options,$status}
                                </select>
                            </div>
                            {if $adminInfo['role']==1}
                            <div class="form-group">
                                <label  >医院：</label>
                                <select name="hospital_id" id="" class="selectpicker">
                                    {:options,$hospitals}
                                </select>
                            </div>
                            {/if}
                            <div class="form-group" style="margin-left: 10px">
                                <button type="submit" class="btn btn-primary">提交</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>




<div class="content">
    <div class="card-body table-responsive" style="padding-top: 0px">
        <a class="btn   btn-outline-primary btn-table-tool btn-dialog" href="{url wait add}&type={$type}" data-area="50%,40%" title="添加排号">新增</a>
    </div>
    <div class="card-body table-responsive" style="padding-top: 0px">
        <table data-table="1" data-url="{url wait ajax_data }&type={$type}" id="table1" class="table table-hover">
            <thead>
            <tr>

                <th data-field="id" data-formatter="epiiFormatter">ID</th>
                <th data-field="num" data-formatter="epiiFormatter">排号</th>
                <th data-field="name" data-formatter="epiiFormatter">姓名</th>
                <th data-field="sex_name" data-formatter="epiiFormatter">性别</th>
                <th data-field="is_vip_name" data-formatter="epiiFormatter">是否vip</th>
                <th data-field="bed" data-formatter="epiiFormatter">床位</th>
                <th data-field="doctor_name" data-formatter="epiiFormatter">挂号医生</th>
                {if $adminInfo['role']==1}
                <th data-field="hospital_name" data-formatter="epiiFormatter">所属医院</th>
                {/if}
                <th data-field="status_name" data-formatter="epiiFormatter">状态</th>
                <th data-field="wait_time" data-formatter="epiiFormatter">等待时间(分钟)</th>

                <th data-field="addtime" data-formatter="epiiFormatter">时间</th>

                <th data-formatter="epiiFormatter.btns"
                    data-btns="edit1,consultation"
                    data-del-url="{url wait del }&id={id}"
                    data-del-title="删除：{name}"
                    data-area="50%,50%"
                >操作
                </th>
            </tr>
            </thead>
        </table>
    </div>

</div>
<script src="{$laydate}/laydate.js"></script>
<script>
    function edit1(field_value, row, index, field_name){
        return '<a class="btn btn-outline-info btn-sm  btn-dialog" href="?app=wait@edit&id=' + row.id + '" data-area="50%,50%" data-title="查看">查看</a>';
    }
    //问诊
    function consultation(field_value, row, index, field_name){
        if(row.type==1){
            //治疗排队隐藏问诊
            return '';
        }
        return '<a class="btn btn-outline-info btn-sm  btn-addtab" href="?app=cases@add_edit&wait_id=' + row.id + '&case_id=' + row.case_id + '" data-area="50%,50%" data-title="【'+row.name+'】问诊">问诊</a>';
    }
    window.onEpiiInit(function() {
        laydate.render({
            elem: '#start',
            trigger: 'click',
            format: 'yyyy-MM-dd',
        });
        laydate.render({
            elem: '#end',
            trigger: 'click',
            format: 'yyyy-MM-dd',
        });
    });
</script>
